<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'menu.label', default: 'Menu')}"/>
    <title>菜单详情</title>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>贷款管理系统</li>
                    <li>
                        <g:link controller="menu" action="index">菜单管理</g:link>
                    </li>
                    <li class="active">
                        <span>菜单详情</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                菜单详情
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:if test="${flash.message}">
            <div class="message alert alert-info" role="status">${flash.message}
                <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
            </div>
        </g:if>
        <div class="hpanel hgreen contact-panel">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" action="edit" resource="${this.menu}"><i
                            class="fa fa-edit"></i>编辑</g:link>
                    <g:form resource="${this.menu}" method="DELETE" style="display: inline-block">
                        <button class="deleteBtn btn btn-danger btn-xs" type="button">
                            <i class="fa fa-trash-o"></i>删除
                        </button>
                    </g:form>
                </div>
                菜单详情
            </div>

            <div class="panel-body">
                <ul class="list-group">
                    <li class="list-group-item">
                        菜单名称: ${this.menu?.name}
                    </li>
                    <li class="list-group-item">
                        菜单标题: ${this.menu?.title}
                    </li>
                    <li class="list-group-item">
                        菜单链接: ${this.menu?.url}
                    </li>
                    <li class="list-group-item">
                        菜单图标: ${this.menu?.icon}
                    </li>
                    <li class="list-group-item">
                        菜单排序: ${this.menu?.orderNum}
                    </li>
                    <li class="list-group-item">
                        菜单状态: ${this.menu?.status}
                    </li>
                    <li class="list-group-item">
                        创建人: ${this.menu?.createBy?.username}
                    </li>
                    <li class="list-group-item">

                        创建时间: <g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${this.menu?.createdDate}"/>
                    </li>
                    <li class="list-group-item">
                        修改人: ${this.menu?.modifyBy?.username}
                    </li>
                    <li class="list-group-item">
                        修改时间: <g:formatDate format="yyyy-MM-dd HH:mm:ss" date="${this.menu?.modifiedDate}"/>
                    </li>
                </ul>
            </div>

        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" controller="menu" action="create"
                            params="[parent: this.menu.id]"><i class="fa fa-plus"></i>新增</g:link>

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                二级菜单
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <ul class="list-group">
                        <g:each in="${this.menu?.getAllChildren()}">
                            <li class="list-group-item">
                                菜单名称: <g:link controller="menu" action="show" id="${it?.id}">${it?.name}</g:link>
                            </li>
                        </g:each>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link class="btn btn-info btn-xs" controller="roleMenu" action="create"
                            params="[menu: this.menu?.id]"><i class="fa fa-plus"></i>新增</g:link>

                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                角色模块
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <ul class="list-group">
                        <g:each in="${com.next.RoleMenu.findAll('from RoleMenu rm where rm.menu.id =' + this.menu.id)}">
                            <li class="list-group-item">
                                角色名称: ${it?.role.description}
                            </li>
                        </g:each>
                    </ul>
                </div>

            </div>
        </div>

    </div>
</body>
</html>
